package com.woniu.dao;

import com.woniu.entity.Perms;
import com.woniu.entity.PermsExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface PermsMapper {
    long countByExample(PermsExample example);

    int deleteByExample(PermsExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Perms record);

    int insertSelective(Perms record);

    List<Perms> selectByExample(PermsExample example);

    Perms selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Perms record, @Param("example") PermsExample example);

    int updateByExample(@Param("record") Perms record, @Param("example") PermsExample example);

    int updateByPrimaryKeySelective(Perms record);

    int updateByPrimaryKey(Perms record);

    @Select("SELECT p.* FROM rbac_perms p INNER JOIN rbac_user_perm up ON p.id=up.permid\n" +
            "                           INNER JOIN rbac_user u ON u.id=up.userid\n" +
            "                           WHERE u.username=#{username} AND TYPE='m'")
    List<Perms> selectPermsByUsername(String username);

    @Select("SELECT * FROM ERP_security_perms")
    List<Perms> selectAllPerms();
}